<template>
    <div>
        <heads title="订单详情"></heads>
        <van-address-list v-model="chosenAddressId" :list="list" :disabled-list="disabledList" add-button-text="去支付"
            default-tag-text="默认" @add="onAdd" @edit="onEdit">
            
        </van-address-list>

    </div>
</template>

<script setup>
import { ref } from 'vue';
import { showToast } from 'vant';
import{payApi} from "@/api/api"
import heads from '@/components/head.vue';
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
const route = useRoute()
let id = ref(route.query.orderId)


const chosenAddressId = ref('1');
const list = [
    {
        id: '1',
        name: '张三',
        tel: '13000000000',
        address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
        isDefault: true,
    }
];


const onEdit = (item, index) => showToast('编辑地址:' + index);
const onAdd = () =>
{
    payApi().then(res=>{
        window.open(res.data.data)
    })
}


</script>

<style lang="scss" scoped></style>